	function ccR_DeathKnight_RoilingBlood()
		local vUseBloodBoil
		local vTargetCount
		if ccrSpec() == 1 then
			vUseBloodBoil = ccRS.DeathKnight_1_UseRoilingBlood
			vTargetCount = ccRS.DeathKnight_1_RoilingBloodCount
		end;
		if ccrSpec() == 2 then
			vUseBloodBoil = ccRS.DeathKnight_2_UseRoilingBlood
			vTargetCount = ccRS.DeathKnight_2_RoilingBloodCount
		end;
		if ccrSpec() == 3 then
			vUseBloodBoil = ccRS.DeathKnight_3_UseRoilingBlood
			vTargetCount = ccRS.DeathKnight_3_RoilingBloodCount
		end;
		if vUseBloodBoil
		and ccrPlayerHasTalent(ROILING_BLOOD)
		and ccrSpellIsReady(BLOOD_BOIL)
		and ccrTargetHasMyDebuff(BLOOD_PLAGUE)
		and ccrTargetHasMyDebuff(FROST_FEVER)
		then
			if ccrPlayerCount(12) >= vTargetCount
			and ( vLastBloodBoilCast == nil	or GetTime()-vLastBloodBoilCast > 0.5 )
			then
				local vBloodPlague = {GetSpellInfo(BLOOD_PLAGUE)}
				local vFrostFever = {GetSpellInfo(FROST_FEVER)}
				for i = 0, # tblPGetMeleeEnemies  do
					local obj = tblPGetMeleeEnemies[i]
					if obj ~= nil
					and not obj:IsDead()
					and (obj:GetAura(vBloodPlague[1]) == nil or obj:GetAura(vFrostFever[1]) == nil)
					then
						ccrCast(BLOOD_BOIL)
						vLastBloodBoilCast = GetTime()
						return
					end;
				end
			end;
			return
		end
		return
	end
	function ccR_DeathKnight_PlagueLeech()
		local vUsePlagueLeech
		if ccrSpec() == 1 then vUsePlagueLeech = ccRS.DeathKnight_1_UsePlagueLeech end
		if ccrSpec() == 2 then vUsePlagueLeech = ccRS.DeathKnight_2_UsePlagueLeech end
		if ccrSpec() == 3 then vUsePlagueLeech = ccRS.DeathKnight_3_UsePlagueLeech end
		if vUsePlagueLeech
		and ccrPlayerHasTalent(PLAGUE_LEECH)
		and ccrSpellCanAttack(PLAGUE_LEECH)
		and (
			(ccrTargetHasMyDebuff(BLOOD_PLAGUE) and ccrTargetHasMyDebuffRemaining(BLOOD_PLAGUE, 5))
			or
			(ccrTargetHasMyDebuff(FROST_FEVER) and ccrTargetHasMyDebuffRemaining(FROST_FEVER, 5))
			)
		then
			local vRuneOnCD = 0;
			for i=1,6 do 
				local start, duration, runeReady = GetRuneCooldown(i)
				if not runeReady then
					vRuneOnCD = vRuneOnCD + 1
				end
			end
			if vRuneOnCD >= 2
			and ccrTargetHasMyDebuff(BLOOD_PLAGUE)
			and ccrTargetHasMyDebuff(FROST_FEVER)
			then
				ccrCastAttack(PLAGUE_LEECH)
				return
			end
			return
		end
		return
	end
	function ccR_DeathKnight_UnholyBlight()
		local vTargetCount
		local vUseUnholyBlight
		if ccrSpec() == 1 then 
			vUseUnholyBlight = ccRS.DeathKnight_1_UseUnholyBlight
			vTargetCount = ccRS.DeathKnight_1_UnholyBlightCount
		end
		if ccrSpec() == 2 then 
			vUseUnholyBlight = ccRS.DeathKnight_2_UseUnholyBlight
			vTargetCount = ccRS.DeathKnight_2_UnholyBlightCount
		end
		if ccrSpec() == 3 then
			vUseUnholyBlight = ccRS.DeathKnight_2_UseUnholyBlight
			vTargetCount = ccRS.DeathKnight_3_UnholyBlightCount
		end

		if ccrPlayerHasTalent(UNHOLY_BLIGHT)
		and vUseUnholyBlight
		and ccrSpellIsReady(UNHOLY_BLIGHT)
		and ccrTargetCount(10) >= vTargetCount
		then
			ccrCast(UNHOLY_BLIGHT)
			return
		end
		return
	end
-- 57
	function ccR_DeathKnight_LichborneHealing()
		local vLichBorneHealingHP
		local vUseLichBorneHealing
		if ccrSpec() == 1 then
			vUseLichBorneHealing = ccRS.DeathKnight_1_UseLichBorneHealing
			vLichBorneHealingHP = ccRS.DeathKnight_1_LichBorneHealingHP
		end
		if ccrSpec() == 2 then
			vUseLichBorneHealing = ccRS.DeathKnight_2_UseLichBorneHealing
			vLichBorneHealingHP = ccRS.DeathKnight_2_LichBorneHealingHP
		end
		if ccrSpec() == 3 then
			vUseLichBorneHealing = ccRS.DeathKnight_3_UseLichBorneHealing
			vLichBorneHealingHP = ccRS.DeathKnight_3_LichBorneHealingHP
		end
		if vUseLichBorneHealing
		and ccrPlayerHasTalent(LICHBORNE)
		and ccrPlayerHasSpell(DEATH_COIL)
		and ccrSpellIsReady(LICHBORNE)
		and ccrPlayerRunicPower() >= 40
		then
			-- Lichborne
			if ccrPlayerHealth() <= vLichBorneHealingHP
			and ccrPlayerRunicPower() >= 40
			then
				ccrCast(LICHBORNE)
			end
		end
		-- Death Coil Healing
		if vUseLichBorneHealing
		and ccrPlayerHasBuff(LICHBORNE)
		and ccrSpellIsReady(DEATH_COIL)
		then
			ccrCast(DEATH_COIL,"Player")
			return
		end
	end
	function ccR_DeathKnight_AntiMagicZone()
		local vUseAntiMagicZone
		if ccrSpec() == 1 then vUseAntiMagicZone = ccRS.DeathKnight_1_UseAntiMagicZone end
		if ccrSpec() == 2 then vUseAntiMagicZone = ccRS.DeathKnight_2_UseAntiMagicZone end
		if ccrSpec() == 3 then vUseAntiMagicZone = ccRS.DeathKnight_3_UseAntiMagicZone end

		if vUseAntiMagicZone
		and ccrPlayerHasTalent(ANTI_MAGIC_ZONE)
		and ccrSpellIsReady(ANTI_MAGIC_ZONE)
		and ccrTargetIsCastingOrChanneling()
		and ccrTargetIsAfterMe()
		then
			ccrCast(ANTI_MAGIC_ZONE)
			if SpellIsTargeting() == 1 then CastAtLocation(Player:GetLocation()) end;
		end
	end
	-- Purgatory (Passive)
-- 58
	function ccR_DeathKnight_Deaths_Advance()

	end
	function ccR_DeathKnight_DeathsAdvance()

		if ccRS.DeathKnight_UseDeathsAdvance
		and ccrPlayerIsMoving()
		and ccrPlayerHasTalent(DEATHS_ADVANCE)
		and ccrSpellIsReady(DEATHS_ADVANCE)
		and UnitOnTaxi("Player") == nil													-- On a Taxi
		and not IsMounted()																-- Mounted
		and HasFullControl() == 1
		and not Player:IsDead()
		and UnitUsingVehicle("Player") == nil
		and IsUsingVehicleControls() == nil
		and not ccrPlayerHasBuff(136461) -- Skin of the Saurok
		then
			ccrCast(DEATHS_ADVANCE)
		end
	end		
	-- Chillblains (Passive)
	function ccR_DeathKnight_Asphyxiate()
		local vUseAsphyxiate
		if ccrSpec() == 1 then vUseAsphyxiate = ccRS.DeathKnight_1_UseAsphyxiate end
		if ccrSpec() == 2 then vUseAsphyxiate = ccRS.DeathKnight_2_UseAsphyxiate end
		if ccrSpec() == 3 then vUseAsphyxiate = ccRS.DeathKnight_3_UseAsphyxiate end

		if ccrPlayerHasTalent(ASPHYXIATE)
		and vUseAsphyxiate
		and	SpellCanAttack(ASPHYXIATE)
		and ccrTargetIsCastingOrChanneling()
		then
			ccrCastAttack(ASPHYXIATE)
			return
		end
	end
-- 60
	function ccR_DeathKnight_Death_Pact()
		local vHealth
		local vUseDeathPact
		if ccrSpec() == 1 then
			vUseDeathPact = ccRS.DeathKnight_1_UseDeathPact 
			vHealth = ccRS.DeathKnight_1_DeathPactHP
		end
		if ccrSpec() == 2 then
			vUseDeathPact = ccRS.DeathKnight_2_UseDeathPact 
			vHealth = ccRS.DeathKnight_2_DeathPactHP 
		end
		if ccrSpec() == 3 then
			vUseDeathPact = ccRS.DeathKnight_3_UseDeathPact 
			vHealth = ccRS.DeathKnight_3_DeathPactHP
		end		
		if vUseDeathPact
		and ccrPlayerHasTalent(DEATH_PACT)
		and ccR_DeathKnight_RisenAlly_Exists()
		and	ccrSpellIsReady(DEATH_PACT)
		and ccrPlayerHealth() <= vHealth
		then
			ccrCast(DEATH_PACT)
		end
	end
	function ccR_DeathKnight_DeathSiphon()
		local vUseDeathRune
		local vHealth
		if ccrSpec() == 1 then
			vUseDeathSiphon = ccRS.DeathKnight_1_UseDeathSiphon
			vHealth = ccRS.DeathKnight_1_DeathSiphonHP
		end
		if ccrSpec() == 2 then
			vUseDeathSiphon = ccRS.DeathKnight_1_UseDeathSiphon
			vHealth = ccRS.DeathKnight_1_DeathSiphonHP
		end
		if ccrSpec() == 3 then
			vUseDeathSiphon = ccRS.DeathKnight_1_UseDeathSiphon
			vHealth = ccRS.DeathKnight_1_DeathSiphonHP
		end

		if ccrPlayerHasTalent(DEATH_SIPHON)
		and vUseDeathSiphon
		and ccrPlayerHealth() <= vHealth
		and ccrSpellCanAttack(DEATH_SIPHON)
		then
			local x
			local vFoundDeathRune = false
			for x = 1, 6 do
				local start, duration, runeReady = GetRuneCooldown(x)
				if GetRuneType(x) == 4
				and runeReady == true
				then
					vFoundDeathRune = true
				end
			end

			if vFoundDeathRune then
				ccrCastAttack(DEATH_SIPHON)
				return
			end
			return
		end
		return
	end
	function ccR_DeathKnight_Conversion()
		local vHealth
		local vHealthMax
		local vUseConversion
		if ccrSpec() == 1 then
			vUseConversion = ccRS.DeathKnight_1_UseConversion
			vHealth = ccRS.DeathKnight_1_ConversionHP
			vHealthMax = ccRS.DeathKnight_1_ConversionHPMax
		end
		if ccrSpec() == 2 then
			vUseConversion = ccRS.DeathKnight_2_UseConversion
			vHealth = ccRS.DeathKnight_2_ConversionHP
			vHealthMax = ccRS.DeathKnight_2_ConversionHPMax
		end
		if ccrSpec() == 3 then
			vUseConversion = ccRS.DeathKnight_3_UseConversion
			vHealth = ccRS.DeathKnight_3_ConversionHP
			vHealthMax = ccRS.DeathKnight_3_ConversionHPMax
		end
		if ccrPlayerHasTalent(CONVERSION)
		and vUseConversion
		then
			-- Cancel Conversion
			if ccrPlayerHealth() >= vHealthMax
			and ccrPlayerHasBuff(CONVERSION)
			then
				CancelUnitBuff(CONVERSION)
				return
			end
			-- Start Conversion
			if ccrPlayerHealth() <= vHealth
			and not ccrPlayerHasBuff(CONVERSION)
			and ccrSpellIsReady(CONVERSION)
			then
				ccrCast(CONVERSION)
				return
			end
		end
	end
-- 75
	function ccR_DeathKnight_BloodTap()
		local vUseBloodTap
		local vBloodTapCount
		if ccrSpec() == 1 then
			vUseBloodTap = ccRS.DeathKnight_1_UseBloodTap
			vBloodTapCount = ccRS.DeathKnight_1_BloodTapCharges
		end
		if ccrSpec() == 2 then
			vUseBloodTap = ccRS.DeathKnight_2_UseBloodTap
			vBloodTapCount = ccRS.DeathKnight_2_BloodTapCharges
		end
		if ccrSpec() == 3 then
			vUseBloodTap = ccRS.DeathKnight_3_UseBloodTap
			vBloodTapCount = ccRS.DeathKnight_3_BloodTapCharges
		end

		if ccrPlayerHasTalent(BLOOD_TAP)
		and vUseBloodTap
		and ccrPlayerHasBuffStacks(BLOOD_CHARGE, vBloodTapCount)
		and ccrSpellIsReady(BLOOD_TAP)
		then
			if (not select(3, GetRuneCooldown(1))
			and not select(3, GetRuneCooldown(2)))
			or (not select(3, GetRuneCooldown(3))
			and not select(3, GetRuneCooldown(4)))
			or (not select(3, GetRuneCooldown(5))
			and not select(3, GetRuneCooldown(6)))
			then
				ccrCast(BLOOD_TAP)
				return
			end
			return
		end
		return	
	end
	-- Runic Empowerment (Passive)
	-- Runic Corruption (Passive)
-- 90
	function ccR_DeathKnight_GorefiendsGrasp()
		local vUseGoreFiendsGrasp
		local vTargetCount
		if ccrSpec() == 1 then
			vUseGoreFiendsGrasp = ccRS.DeathKnight_1_UseGoreFiendsGrasp
			vTargetCount = ccRS.DeathKnight_1_GorefiendsGraspCount
		end
		if ccrSpec() == 2 then
			vUseGoreFiendsGrasp = ccRS.DeathKnight_2_UseGoreFiendsGrasp
			vTargetCount = ccRS.DeathKnight_2_GorefiendsGraspCount
		end
		if ccrSpec() == 3 then
			vUseGoreFiendsGrasp = ccRS.DeathKnight_3_UseGoreFiendsGrasp
			vTargetCount = ccRS.DeathKnight_3_GorefiendsGraspCount
		end

		if vUseGoreFiendsGrasp
		and ccrPlayerHasTalent(GOREFINDS_GRASP)
		and	ccrSpellIsReady(GOREFINDS_GRASP)
		and ccrPlayerCount(20) >= vTargetCount
		then
			ccrCast(GOREFINDS_GRASP)
			return
		end
		return
	end
	function ccR_DeathKnight_RemorselessWinter()
		local vUseRemorselessWinter
		local vTargetCount
		if ccrSpec() == 1 then
			vUseRemorselessWinter = ccRS.DeathKnight_1_UseRemorselessWinter
			vTargetCount = ccRS.DeathKnight_1_RemorselessWinterCount
		end
		if ccrSpec() == 2 then
			vUseRemorselessWinter = ccRS.DeathKnight_2_UseRemorselessWinter
			vTargetCount = ccRS.DeathKnight_2_RemorselessWinterCount
		end
		if ccrSpec() == 3 then
			vUseRemorselessWinter = ccRS.DeathKnight_3_UseRemorselessWinter
			vTargetCount = ccRS.DeathKnight_3_RemorselessWinterCount
		end

		if vUseRemorselessWinter
		and ccrPlayerHasTalent(REMORSELESS_WINTER)
		and	ccrSpellIsReady(REMORSELESS_WINTER)
		and ccrPlayerCount(10) >= vTargetCount
		then
			ccrCast(REMORSELESS_WINTER)
			return
		end
		return
	end
	-- ## TODO: Find a list of effects Desecrated Ground removes 
	function DK_DesecratedGround()
	end